#面向过程
stu1 = {'name':'xiaohong','score':98}   #字典
stu1 = {'name':'xiaobai','score':89}
def print_score(stu):
    print('%s:%s'%(stu['name'],stu['score']))
#面向对象
#1.设计类
# 属性和方法
class Student(object):
    #方法 self指向创建的实例本身
    def __init__(self,name,score):
        self.name = name
        self.score = score
    def print_score(self):
        print('%s:%s'%(self.name,self.score))
#实例化对象1
xiaohong = Student('xiaohong',98)
#实例化对象2
xiaobai = Student('xiaobai',81)

print(xiaobai.name,xiaobai.score)
# xiaohong.print_score()
# xiaobai.print_score()